﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.Master" AutoEventWireup="true" CodeBehind="report_by_customer.aspx.cs" Inherits="LinkCard.AdminCP.Reports.report_by_customer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script language="javascript">
        function setValue(page) {
            location.href = 'report_detail.aspx?page=' + page;
        }

        var $j = jQuery.noConflict(); //set no conflict so you can use with MS AJAX.


        $j(document).ready(function () {
            $j("#<%=FromDate.ClientID %>").datepicker();
            $j("#<%=ToDate.ClientID %>").datepicker();
            //$("#datepicker").datepicker();
        });

    </script>
    <section id="content">
  <section class="container_12 clearfix">
    <section id="main" class="grid_12">
      <article>
        <div class="h1">Quản lý hoá đơn bán hàng</div>
          <div class="box search">
       Từ ngày&nbsp;
           <%-- <input type="text"  size="25" id="FromDate" runat="server" />--%>
             <input type="text" id="FromDate" runat="server">
         &nbsp;&nbsp;&nbsp;Đến ngày&nbsp; 
       <%--  <input type="text"  size="25" id="ToDate" runat="server" />--%>
        <input type="text" id="ToDate" runat="server">
              &nbsp;&nbsp;&nbsp;Mã thẻ&nbsp; 
           <input type="text" id="txtCardNumber" runat="server">
          <asp:Button ID="btnSearch" class="button small" Style="width: 60px;"
                                runat="server" Text="Tìm kiếm" OnClick="btnSearch_Click"/>
        
      </div>
          <table id="table1" class="gtable sortable" >
            <thead>
              <tr>
                <th>Ngày</th>
                <th style="text-align:right">Mã thẻ</th>
                <th style="text-align:right">Tên Khách hàng</th>
                <th style="text-align:right">Số hoá đơn</th>
                <th style="text-align:right">Hình thức thanh toán</th>
                <th style="text-align:right">Tổng tiền/điểm thanh toán</th>
                <th ></th>
              </tr>
            </thead>
            <tbody>
            <asp:Repeater ID="msgList" runat="server">
                        <ItemTemplate>
                            <tr>
                                <td >
                                    <%# Convert.ToDateTime(DataBinder.Eval(Container.DataItem, "PayDate")).ToString("dd/MM/yyyy")%>
                                </td>
                                <td align="right">
                                    <%# DataBinder.Eval(Container.DataItem, "CardNumber")%>
                                </td>
                                <td align="right">
                                    <%# DataBinder.Eval(Container.DataItem, "Fullname") %>
                                </td>
                                <td align="right">
                                    <%# LinkCard.AdminCP.Common.Utility.sDecimal(LinkCard.AdminCP.Common.ConvertUtility.ToDecimal(DataBinder.Eval(Container.DataItem, "PayID"))) %>
                                </td>
                                 <td align="right">
                                   <%#(DataBinder.Eval(Container.DataItem,"PayMethod").ToString()== "0" )? " Tiền mặt ": " Điểm "%>
                                </td>
                                <td align="right">
                                    <%# LinkCard.AdminCP.Common.Utility.sDecimal(LinkCard.AdminCP.Common.ConvertUtility.ToDecimal(DataBinder.Eval(Container.DataItem, "PayAmount")))%>
                                </td>
                              
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                    <tr id="msgNoData" runat="server">
                        <td colspan="4" align="center">
                            Không có dữ liệu!
                        </td>
                    </tr>
              
              
            </tbody>
          </table>
          <div class="tablefooter clearfix">
            <div class="actions">
              <select id="ActionOption" runat="server">
                <option value="0">Xuất excel</option>
              </select>
              
              <asp:Button ID="btnExportExcel" 
                                runat="server" Text="Thực hiện"  class="button small" 
                    style="width:80px;" OnClick="btnExportExcel_Click"/>
            </div>
            <div class="pagination" id="divPager" runat="server">
               <asp:Literal ID="PagerShow" runat="server"></asp:Literal>
               </div>
          </div>
       
      </article>
    </section>
    
  </section>
</section>
</asp:Content>
